package com.loveprogrammer.eternity.model;

import com.loveprogrammer.eternity.common.Tuple;
import com.loveprogrammer.eternity.enums.EffectTimeEnum;
import com.loveprogrammer.eternity.model.attack.AttackEntity;
import com.loveprogrammer.eternity.model.attack.AttackResult;
import com.loveprogrammer.eternity.model.effect.AbstractEffect;
import com.loveprogrammer.eternity.notify.Notify;
import com.loveprogrammer.eternity.skill.Skill;
import com.loveprogrammer.eternity.skill.State;

import java.util.List;
import java.util.concurrent.ScheduledExecutorService;

/***
 * 攻击相关的接口
 */
public interface Attackable {

    Tuple<String,List<Character>> attack(List<? extends Character> characters);

    Tuple<String, List<Character>> tryToLaunchSkill(List<Skill> skillList,
                                                    List<? extends Character> campA,
                                                    List<? extends Character> campB,
                                                    ScheduledExecutorService subFightExecutorService);

    /**
     * 伤害 伤害类型
     * @Param [harm, type]
     * @return java.lang.String
     **/
    AttackResult defence(AttackEntity harm);

    /**
     * 检查自己是否已经死了
     **/
    boolean checkDead();

    /**
     * 获得一种状态 单位秒
     **/
    boolean acquireState(State state, int time);

    /**
     * 移除一种状态
     **/
    boolean removeState(State state);

    /**
     * 添加注册观察者
     * @param observer
     */
    void regEffect(AbstractEffect effect);
    /**
     * 删除观察者
     * @param observer
     */
    void delEffect(AbstractEffect observer);

    /**
     * 通知所有的观察者
     *
     * @param message
     * @return
     */
//    StringBuilder notifyEffect(Character attack,
//                               EffectTimeEnum effectTimeEnum,
//                               AttackResult result,
//                               List<? extends Character> attackList,
//                               Character... defence);

}
